]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
runDialog: Let history trim input
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Thu, 11 Feb 2021 18:35:07 +0000 (19:35 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 13 Feb 2021 08:58:20 +0000 (08:58 +0000)
Checking whether the item is empty is now the history’s job, per the
previous commit. The history also returns the trimmed input for us, so
we can avoid doing that work twice.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1653>

js/ui/runDialog.js

index a01af5c9d5fe7351ee723bb147c4ddeb17b83319..bc9689d4d183a6abdb7505fe4169edc43dde8d67 100644 (file)
@@ -178,11 +178,9 @@ class RunDialog extends ModalDialog.ModalDialog {
     }
 
     _run(input, inTerminal) {
-        input = input.trim();
+        input = this._history.addItem(input); // trims input
         let command = input;
 
-        if (input)
-            this._history.addItem(input);
         this._commandError = false;
         let f;
         if (this._enableInternalCommands)